/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#pragma once

#include <map>
#include <向量.h>

#include "物体/物体.h"



struct S_集合 : S_Object {
	std::map<uint32, S_集合*>	m_子层;

	std::vector<S_物体*>			m_物体;


	S_集合(uint32 key = -1);

	static S_集合*			f_get(uint32 key);


};


inline uint32 f_get坐标哈希(const vec3& coord, float32 单元大小) {
	vec3 缩放后坐标 = vec_div(coord, 单元大小);
	return f_PackData3X32f(svec3{ int16(缩放后坐标.x), int16(缩放后坐标.y), int16(缩放后坐标.z) });
}

void f_添加物体(S_集合* 集合, S_物体* obj, uint32* 子到父ID, int32 d);






